<?php
/*
 * [佳喜网络!] (C)2008-2009 JiaXi Inc.
 * $Id: include.php 2008-8-13 19:28:02 pepsi.zh $
 * -------------------------------------------
 * 网址：www.he88.cn
 * -------------------------------------------
 * 这是一个共享软件，遵循我们公司的共享协议。
*/
include_once('include/include.php');

$outvar[jslist][] = DEFAULT_JS_URL.'add_site.js';
$outvar[contenttitle] = '添加网站';
c_create::createClass('site');
$site = new site();
c_create::createClass('catagory');
$cata = new catagory();

if ($_POST){
	$_POST[userId] = $_SESSION[userId];
	if ($site->addRecord($_POST)){
		$_SESSION[showtip] = '网站添加成功！';
		header('location:site_list.php');
		exit;
	}else {
		$_SESSION[showtip] = $site->action.'失败';
	}
	$outvar = addArray($outvar,$site->error);
}elseif ($_GET[id]){
	$_POST = $site->getOneRecord($_GET[id],TRUE,$_SESSION[userId]);
}

if($_POST){
	$outvar = addArray($outvar,$_POST);
	$outvar[maxbelongid] = $cata->getParentByChild($_POST[zbelongid],'zbelongid');
}
if ($_POST[zsiteid]){
	$outvar[contenttitle] = '修改网站';
}

$outvar[webtype_max] = $cata->getRecordParent(false);
$outvar[webtype_min] = $cata->getRecordChild(false);

setnavi(1);
$outvar[includeT] = 'member/site_add';
outFile('member/main');
?>